#include <iostream>
#include <string>
#include <stdlib.h>
#include <stdio.h>

using namespace std;

int main()
{
	string  department[] = {"02", "03", "04", "08", "10"};

for(int i = 0; i < 5; i++)
{

	char sqlStatement[550]  =        "SELECT  sp46212.intersection.ideptnum, sp46212.department.deptname,\n"
                                         "        sp46212.department.deptlocation, sp46212.intersection.ifacnum,\n"
                                         "        sp46212.faculty.facname, sp46212.faculty.facrank, sp46212.faculty.facyearstart\n"
			                 "FROM    sp46212.department\n"
			                 "JOIN    sp46212.intersection\n"
			                 "ON      sp46212.department.deptnum = sp46212.intersection.ideptnum\n"
			                 "JOIN    sp46212.faculty\n"
			                 "ON      sp46212.intersection.deptnum = sp46212.faculty.facnum\n"
			                 "WHERE   sp46212.department.deptnum = ";

	strcat((char*) sqlStatement,  department[i].c_str());
									
        cout << "\n\nQuery is:\n" << sqlStatement << endl;
}
return 0;
}
